package com.tt.fashionWebSite.domain;

import javax.persistence.*;
import java.io.Serializable;

@SuppressWarnings("serial")
@Entity
@Table(name = "chi_tiet_san_pham")
@NamedQueries({
        @NamedQuery(name = "getProductDetail", query = "SELECT c FROM ChiTietSanPham c") ,
        @NamedQuery(name = "getSearchDetailOfId",query = "SELECT s FROM ChiTietSanPham s " +
                "WHERE s.sanPham.maSP = :maSP " ) ,
})
public class ChiTietSanPham implements Serializable {

    public static final String GET_PRODUCTDETAIL_ALL = "getProductDetail";
    public static final String GET_SEARCH_DETAIL_OF_ID = "getSearchDetailOfId";

    @Id
    @Column(name = "MA_CT_SP")
    private String maCTSP;

    @ManyToOne
    @JoinColumn(name = "MA_SP")
    private SanPham sanPham;

    @ManyToOne
    @JoinColumn(name = "MA_MAU_SAC")
    private MauSac mauSac;

   @ManyToOne
   @JoinColumn(name = "MA_SIZE")
    private KichThuoc kichThuoc;

   @ManyToOne
   @JoinColumn(name = "MA_HOA_TIET")
   private HoaTiet hoaTiet;

    @Column(name = "GIA_SP")
    private Double giaSP;

    @Column(name = "SO_LUONG")
    private Long soLuong;

   public String getMaCTSP() {
      return maCTSP;
   }

   public void setMaCTSP(String maCTSP) {
      this.maCTSP = maCTSP;
   }

   public SanPham getSanPham() {
        return sanPham;
    }

    public void setSanPham(SanPham sanPham) {
        this.sanPham = sanPham;
    }

    public MauSac getMauSac() {
        return mauSac;
    }

    public void setMauSac(MauSac mauSac) {
        this.mauSac = mauSac;
    }

    public KichThuoc getKichThuoc() {
        return kichThuoc;
    }

    public void setKichThuoc(KichThuoc kichThuoc) {
        this.kichThuoc = kichThuoc;
    }

    public Double getGiaSP() {
        return giaSP;
    }

    public void setGiaSP(Double giaSP) {
        this.giaSP = giaSP;
    }

    public Long getSoLuong() {
        return soLuong;
    }

    public void setSoLuong(Long soLuong) {
        this.soLuong = soLuong;
    }

   public HoaTiet getHoaTiet() {
      return hoaTiet;
   }

   public void setHoaTiet(HoaTiet hoaTiet) {
      this.hoaTiet = hoaTiet;
   }
}
